<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

    <div id="app">
        <counter-button></counter-button>
        <counter-button></counter-button>
        <counter-button></counter-button>
        <counter-button></counter-button>
    </div>
    

    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
        
    <script>
        Vue.component('counter-button', {
            data: function(){
                return {
                    count: 0
                };
            },
            template: `
                <button type="button" @click="count++">点击了{{count}}次</button>
            `
        })
        var app = new Vue({
            el: '#app'
        });
    </script>

    <style scoped>
    </style>
</body>
</html>